'''
第69练:定义计算器类
需求:定义一个简单的计算器类，这个类支持加、减、乘、除四种基本运算。
'''

class Caculator:
	"""docstring for Caculator"""
	def __init__(self, num1,num2):
		self.num1 = num1
		self.num2 = num2

	def add(self):
		return self.num1+self.num2

	def reduce(self):
		return self.num1-self.num2

	def multiply(self):
		return self.num1*self.num2

	def divide(self):
		if self.num2==0:
			raise ValueError("被除数不能为0")
		return self.num1/self.num2

caculator=Caculator(10,0)
print(caculator.add())
print(caculator.reduce())
print(caculator.multiply())
print(caculator.divide())